#ifndef CAMERA2DCOMPONENT_H_
#define CAMERA2DCOMPONENT_H_

#include <string>

#include "LibraryFrameworkExport.h"
#include "Game/GameTime.h"
#include <iosfwd>
#include "Entities/Components/CameraComponent.h"
#include <string>
#include "Transform2DComponent.h"

namespace CasaEngine
{
	/*
	 *	
	 */
	class LIBRARY_FRAMEWORK_EXPORT Camera2DComponent :
		public CameraComponent
	{
	public:
		Camera2DComponent(BaseEntity* pEntity_);
		virtual ~Camera2DComponent();

		//all entities must implement an update function
		void Initialize();

		//all entities must implement an update function
		void  Update(const GameTime& gameTime_);		

		//all entities can communicate using messages. They are sent
		//using the MessageDispatcher singleton class
		//void HandleEvent(const Event* pEvent_);

		//entities should be able to read/write their data to a stream
		void Write(std::ostream&  os)const;
		void Read (std::ifstream& is);


	private:
		void ComputeProjectionMatrix();
		
	private:
		Transform2DComponent* m_pTransform;
		Vector2F m_Position;
		float m_Zoom;
	};

}

#endif // CAMERA2DCOMPONENT_H_


